import 'package:lcapp/data/vip_type_data_entity.dart';

vipTypeDataEntityFromJson(VipTypeDataEntity data, Map<String, dynamic> json) {
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['type'] != null) {
		data.type = json['type'].toString();
	}
	if (json['priceOriginal'] != null) {
		data.priceOriginal = json['priceOriginal'] is String
				? double.tryParse(json['priceOriginal'])
				: json['priceOriginal'].toDouble();
	}
	if (json['priceCurrent'] != null) {
		data.priceCurrent = json['priceCurrent'] is String
				? double.tryParse(json['priceCurrent'])
				: json['priceCurrent'].toDouble();
	}
	if (json['priceReduced'] != null) {
		data.priceReduced = json['priceReduced'] is String
				? double.tryParse(json['priceReduced'])
				: json['priceReduced'].toDouble();
	}
	return data;
}

Map<String, dynamic> vipTypeDataEntityToJson(VipTypeDataEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['id'] = entity.id;
	data['type'] = entity.type;
	data['priceOriginal'] = entity.priceOriginal;
	data['priceCurrent'] = entity.priceCurrent;
	data['priceReduced'] = entity.priceReduced;
	return data;
}